/*
 * InterruptHandler.h
 *
 *  Created on: 14/04/2013
 *      Author: roger
 */

#ifndef INTERRUPTHANDLER_H_
#define INTERRUPTHANDLER_H_
#include "Arduino.h"


class InterruptHandler {
private:
	int blinkPin;
	int pulsePin;

public:
	InterruptHandler(const int pin,const int pin2);
	InterruptHandler();
	virtual ~InterruptHandler();
	void setup(const int pin,const int pin2);
	void checkPulse();
	int getAverageBPM();
	int getCurrentBPM();

	volatile int BPM; // used to hold the pulse rate
	volatile int averageBPM; // used to hold the pulse rate
	volatile int averageBPMCount; // used to hold the pulse rate


};

extern InterruptHandler INTERRUPTHANDLER;

#endif /* INTERRUPTHANDLER_H_ */
